package 力扣日常刷题.木23一月.第03天303;

/**
 * @author 帅小伙
 * @date 2022/3/3
 * @description
 */
public class Demo32N3网格图涂色的方案数 {

    static final int MOD = 1000000007;

    public int numOfWays(int n) {
        // ABC ABA
        long fi0 = 6,fi1 = 6;

        for (int i = 2; i <= n; i++) {
            long newFi0 = (2 * fi0 + 2 * fi1) %MOD;
            long newFi1 = (2 * fi0 + 3 * fi1) %MOD;
            fi0 = newFi0;
            fi1 = newFi1;
        }
        return (int) ((fi1+fi0) % MOD);

    }

}
